

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>增加/删除 OSD &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="../../../_static/favicon.ico"/>
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/underscore.js"></script>
        <script src="../../../_static/doctools.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../../genindex/" />
    <link rel="search" title="Search" href="../../../search/" />
    <link rel="next" title="增加/拆除元数据服务器" href="../ceph-deploy-mds/" />
    <link rel="prev" title="密钥管理" href="../ceph-deploy-keys/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../../" class="icon icon-home"></a> &raquo;</li>
        
          <li><a href="../../">Ceph 存储集群</a> &raquo;</li>
        
          <li><a href="../">Ceph 部署</a> &raquo;</li>
        
      <li>增加/删除 OSD</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="../../../_sources/rados/deployment/ceph-deploy-osd.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../../">
          

          
            
            <img src="../../../_static/logo.png" class="logo" alt="Logo"/>
          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../start/intro/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephadm/">Cephadm</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../">Ceph 存储集群</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../configuration/">配置</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../">部署</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../preflight-checklist/">飞前检查</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-deploy-install/">安装 Ceph</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-deploy-new/">创建集群</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-deploy-mon/">增加/删除监视器</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-deploy-keys/">密钥管理</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">增加/删除 OSD</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id1">罗列磁盘</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id2">擦净磁盘</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id3">创建 OSD</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id4">罗列 OSD</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id5">拆除 OSD</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-deploy-mds/">增加/删除 MDS</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-deploy-purge/">删减主机</a></li>
<li class="toctree-l3"><a class="reference internal" href="../ceph-deploy-admin/">管理任务</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../operations/">运维</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../man/">手册页</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../troubleshooting/">故障排除</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../api/">APIs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <div class="section" id="osd">
<h1>增加/删除 OSD<a class="headerlink" href="#osd" title="Permalink to this headline">¶</a></h1>
<p>新增和拆除 Ceph 的 OSD 进程相比其它两种要多几步。 OSD 守护进程把数据写入磁盘和日志，所以你得相应地提供一 OSD 数据盘和日志分区路径（这是最常见的配置，但你可以按需调整）。</p>
<p>从 Ceph v0.60 起， Ceph 支持 <code class="docutils literal notranslate"><span class="pre">dm-crypt</span></code> 加密的硬盘，在准备
OSD 时你可以用 <code class="docutils literal notranslate"><span class="pre">--dm-crypt</span></code> 参数告诉 <code class="docutils literal notranslate"><span class="pre">ceph-deploy</span></code> 你想用加密功能。也可以用 <code class="docutils literal notranslate"><span class="pre">--dmcrypt-key-dir</span></code> 参数指定 <code class="docutils literal notranslate"><span class="pre">dm-crypt</span></code>
加密密钥的位置。</p>
<p>在投建一个大型集群前，你应该测试各种驱动器配置来衡量其吞吐量。详情见<a class="reference external" href="../../../start/hardware-recommendations#data-storage">数据存储</a>。</p>
<div class="section" id="id1">
<h2>罗列磁盘<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
<p>执行下列命令罗列一节点上的磁盘：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">deploy</span> <span class="n">disk</span> <span class="nb">list</span> <span class="p">{</span><span class="n">node</span><span class="o">-</span><span class="n">name</span> <span class="p">[</span><span class="n">node</span><span class="o">-</span><span class="n">name</span><span class="p">]</span><span class="o">...</span><span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="id2">
<h2>擦净磁盘<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h2>
<p>用下列命令擦净（删除分区表）磁盘，以用于 Ceph ：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">deploy</span> <span class="n">disk</span> <span class="n">zap</span> <span class="p">{</span><span class="n">osd</span><span class="o">-</span><span class="n">server</span><span class="o">-</span><span class="n">name</span><span class="p">}</span> <span class="p">{</span><span class="n">disk</span><span class="o">-</span><span class="n">name</span><span class="p">}</span>
<span class="n">ceph</span><span class="o">-</span><span class="n">deploy</span> <span class="n">disk</span> <span class="n">zap</span> <span class="n">osdserver1</span> <span class="o">/</span><span class="n">dev</span><span class="o">/</span><span class="n">sdb</span> <span class="o">/</span><span class="n">dev</span><span class="o">/</span><span class="n">sdc</span>
</pre></div>
</div>
<div class="admonition important">
<p class="admonition-title">Important</p>
<p>这会删除所有数据。</p>
</div>
</div>
<div class="section" id="id3">
<h2>创建 OSD<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h2>
<p>创建集群、安装 Ceph 软件包、收集密钥完成后你就可以创建 OSD 并把它们部署到 OSD 节点了。如果你想敲定某磁盘或擦净它，以便用作
OSD ，参见<a class="reference internal" href="#id1">罗列磁盘</a>和<a class="reference internal" href="#id2">擦净磁盘</a>。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">deploy</span> <span class="n">osd</span> <span class="n">create</span> <span class="o">--</span><span class="n">data</span> <span class="p">{</span><span class="n">data</span><span class="o">-</span><span class="n">disk</span><span class="p">}</span> <span class="p">{</span><span class="n">node</span><span class="o">-</span><span class="n">name</span><span class="p">}</span>
</pre></div>
</div>
<p>例如：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">deploy</span> <span class="n">osd</span> <span class="n">create</span> <span class="o">--</span><span class="n">data</span> <span class="o">/</span><span class="n">dev</span><span class="o">/</span><span class="n">ssd</span> <span class="n">osd</span><span class="o">-</span><span class="n">server1</span>
</pre></div>
</div>
<p>对于 bluestore （默认的）本例假设一个 Ceph OSD 守护进程使用一个磁盘。也支持 Filestore ，此时除了 <code class="docutils literal notranslate"><span class="pre">--filestore</span></code> 之外还得用 <code class="docutils literal notranslate"><span class="pre">--journal</span></code> 来定义远程主机上的日志设备。</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>在一个节点运行多个 OSD 守护进程、且多个 OSD 守护进程共享一个日志分区时，你应该考虑整个节点的最小 CRUSH 故障域，因为如果这个 SSD 坏了，所有用其做日志的 OSD 守护进程也会失效。</p>
</div>
</div>
<div class="section" id="id4">
<h2>罗列 OSD<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h2>
<p>要罗列一节点上部署的所有 OSD ，用此命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span><span class="o">-</span><span class="n">deploy</span> <span class="n">osd</span> <span class="nb">list</span> <span class="p">{</span><span class="n">node</span><span class="o">-</span><span class="n">name</span><span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="id5">
<h2>拆除 OSD<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h2>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>稍后完成。手动过程见<a class="reference external" href="../../operations/add-or-rm-osds#removing-osds-manual">删除 OSD</a> 。</p>
</div>
</div>
</div>



           </div>
           
          </div>
          <footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
        <a href="../ceph-deploy-mds/" class="btn btn-neutral float-right" title="增加/拆除元数据服务器" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
        <a href="../ceph-deploy-keys/" class="btn btn-neutral float-left" title="密钥管理" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).

    </p>
  </div> 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>